﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Cloak.NUnit;
using NUnit.Framework;

namespace Ruleweaver.Rules
{
	public class CreateLambdaRule : Behavior
	{
		private Expression<Func<int, bool>> _lambda;
		private LambdaRule _lambdaRule;

		protected override void Given()
		{
			_lambda = i => true;
		}

		protected override void When()
		{
			_lambdaRule = Rule.Lambda(_lambda);
		}

		[Then]
		public void LambdaIsOriginal()
		{
			Assert.AreEqual(_lambda, _lambdaRule.Lambda);
		}

		[Then]
		public void HasLambdaType()
		{
			Assert.AreEqual(RuleType.Lambda, _lambdaRule.Type);
		}
	}
}